package com.sl.dev.modular.file.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.dev.modular.file.entity.DevFileRelation;
import com.sl.dev.modular.file.mapper.DevFileRelationMapper;
import com.sl.dev.modular.file.service.DevFileRelationService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevFileRelationServiceImpl extends ServiceImpl<DevFileRelationMapper, DevFileRelation> implements DevFileRelationService {
    @Override
    public List<DevFileRelation> getByRelationId(String relationId, String relationTypeCode) {
        LambdaQueryWrapper<DevFileRelation> relationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        relationLambdaQueryWrapper.eq(DevFileRelation::getRelationId, relationId);
        relationLambdaQueryWrapper.eq(DevFileRelation::getRelationTypeCode, relationTypeCode);
        return super.list(relationLambdaQueryWrapper);
    }
}
